package com.aaa.springsecutitythymeleaf1.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @author:LiWei
 * @date:2023年01月03日19:08
 */
@RestController
@RequestMapping("/user")

public class UserController {
    @GetMapping("/insert")
    @PreAuthorize("hasAuthority('user:insert')")
    public String insert(){
        return "用户添加的操作";
    }

    @GetMapping("/delete")
    @PreAuthorize("hasAuthority('user:delete')")
    public String delete(){
        return "用户删除的操作";
    }

    @GetMapping("/update")
    @PreAuthorize("hasAuthority('user:update')")
    public String update(){
        return "用户修改的操作";
    }

    @GetMapping("/select")
    @PreAuthorize("hasAuthority('user:select')")
    public String select(){
        return "admin用户查询的操作";
    }

    @GetMapping("/query")
    @PreAuthorize("hasAuthority('user:query')")
    public String query(){
        return "汪鹏用户添加的操作";
    }

    @GetMapping("/export")
    @PreAuthorize("hasAuthority('user:export')")
    public String export(){
        return "用户导出的操作";
    }

}